/*****************************************************************************/
/**
*
* @file ugpiops.h
*
* Contains specific hardware sets of gpios of zedboard.
*
* <pre>
* MODIFICATION HISTORY:
*
* Ver   Who    Date   	Changes
* ----- ---- ---------- -------------------------------------------------------
* 0.01  abu  01/02/2019 First release
* </pre>
*
******************************************************************************/
#ifndef UGPIOPS_HW_H		/* prevent circular inclusions */
#define UGPIOPS_HW_H		/* by using protection macros */
	
#ifdef __cplusplus
	extern "C" {
#endif

/***************************** Include Files *********************************/
#include "ugpiops.h"

/************************** Constant Definitions *****************************/

/**************************** Type Definitions *******************************/
//================================================================
//
typedef struct {
	uGpioPs_Output Pin;
	u32 ON;
	u32 OFF;
}uGpioPs_Led;

//================================================================

/***************** Macros (Inline Functions) Definitions *********************/
#define LED_NUMBER 8U
#define SW_SPDT_NUMBER 8U

//define functions
#define LED_ON(LedNum)	XGpioPs_WritePin(xGpioPs_Ptr,LED[LedNum].Pin.PinNum,LED[LedNum].ON)
#define LED_OFF(LedNum)	XGpioPs_WritePin(xGpioPs_Ptr,LED[LedNum].Pin.PinNum,LED[LedNum].OFF)

/************************** Variable Definitions *****************************/
typedef enum {
	uCPU0,
	uCPU1,
}uCpuId;

//=========================================================================
//define basic properties of output leds, input switches, and input buttons
//define 8 leds
uGpioPs_Led LED[LED_NUMBER] = {		{{(u8)54U, (u32)0U}, (u8)1U, (u8)0U},
									{{(u8)55U, (u32)0U}, (u8)1U, (u8)0U},
									{{(u8)56U, (u32)0U}, (u8)1U, (u8)0U},
									{{(u8)57U, (u32)0U}, (u8)1U, (u8)0U},
									{{(u8)58U, (u32)0U}, (u8)1U, (u8)0U},
									{{(u8)59U, (u32)0U}, (u8)1U, (u8)0U},
									{{(u8)60U, (u32)0U}, (u8)1U, (u8)0U},
									{{(u8)61U, (u32)0U}, (u8)1U, (u8)0U},
};

//define 8 single pole double throw switches
uGpioPs_Input SW_SPDT[SW_SPDT_NUMBER] = {	{62U, InterruptDisable, {IntrAnyEdge, 10, uCPU0, uSW0_Handler}},
											{63U, InterruptDisable, {IntrAnyEdge, 10, uCPU0, uSW1_Handler}},
											{64U, InterruptDisable, {IntrAnyEdge, 10, uCPU0, uSW2_Handler}},
											{65U, InterruptDisable, {IntrAnyEdge, 10, uCPU0, uSW3_Handler}},
											{66U, InterruptDisable, {IntrAnyEdge, 10, uCPU0, uSW4_Handler}},
											{67U, InterruptDisable, {IntrAnyEdge, 10, uCPU0, uSW5_Handler}},
											{68U, InterruptDisable, {IntrAnyEdge, 10, uCPU0, uSW6_Handler}},
											{69U, InterruptDisable, {IntrAnyEdge, 10, uCPU0, uSW7_Handler}},
};

/************************** Function Prototypes ******************************/


#ifdef __cplusplus
}
#endif

#endif
